<?php
/**
 * PhpStorm
 * User: zucheng
 * Date: 2019/4/12
 */

use Illuminate\Database\Seeder;

class CarTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     * @return void
     */
    public function run()
    {
        \App\Models\CarSite::truncate();
        \App\Models\CarScheme::truncate();

        $sites = [
            ['site_key' => '普通', 'site_value' => '普通', 'site_type' => 1],
            ['site_key' => '半挂', 'site_value' => '半挂', 'site_type' => 1],
            ['site_key' => '平板', 'site_value' => '平板', 'site_type' => 2],
            ['site_key' => '高低板', 'site_value' => '高低板', 'site_type' => 2],
            ['site_key' => '4M以下', 'site_value' => '4M以下', 'site_type' => 3],
            ['site_key' => '4.2M', 'site_value' => '4.2M', 'site_type' => 3],
        ];
        foreach ($sites as $site) {
            \App\Models\CarSite::create($site);
        }

        $carSites = [
            ['model_site_id'=>1, 'box_site_id'=> 3, 'length_site_id'=> 5],
            ['model_site_id'=>2, 'box_site_id'=> 4, 'length_site_id'=> 6],
            ['model_site_id'=>1, 'box_site_id'=> 4, 'length_site_id'=> 6],
            ['model_site_id'=>2, 'box_site_id'=> 3, 'length_site_id'=> 5],
        ];
        foreach ($carSites as $carSite) {
            \App\Models\CarScheme::create($carSite);
        }

    }
}